#!/usr/bin/python
# -*- coding: utf-8 -*-
import re

# 常用正则表达式
MAC_ADDRESS= r"[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}-[A-F0-9]{2}|[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}"
IP_ADDRESS = r"(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])"
FILTER_IP_ADDRESS = ''


if __name__ == '__main__':
    s = """
        00:A9:B6:EF:C3:B5 This is a MAC,
        00-EF-C7-8F-35-A3 This also a MAC
        192.168.1.1 This is a ip
    """
    p = re.compile(MAC_ADDRESS, flags=re.M|re.I)
    print(p.findall(s))

